﻿@page "/company"
@inject MessageService ms

<ValidateForm @ref="CompanyValidate" Model="Dto" ValidateAllProperties="true">
    <div class="row g-3 form-inline">
        <div class="col-12 col-sm-6 col-md-6">
            <BootstrapInput @bind-Value="Dto.Name" />
        </div>
    </div>
    <Button ButtonType="ButtonType.Submit" Text="保存" OnClick="OnSaveAsync" />
</ValidateForm>

@code {
    [Parameter]
    public CompanyBaseDto Dto { get; set; } = new ShanghaiCompany();

    public ValidateForm CompanyValidate;

    async Task OnSaveAsync()
    {
        if (CompanyValidate.Validate())
        {
            await ms.Show(new MessageOption() { Content = "通过" });
        }
    }
}
